Repository navigation
refactor(daemon): trim expired-lease admission code - #5164
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Size Report
Startup median (7 runs, lower is better):
|
Inlining it added a branch that put createRequestExecutionScope over the Fallow cyclomatic threshold. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
|
This is ready at bd71651, with no code changes required. CI checks pass, with Proof skipped. Not verified here: local test, Fallow and format runs, the temporary |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Apex Sentinel · ✅ Approve · review of
|
| Command | What it does |
|---|---|
@apex-sentinel-staging note <context> |
Adds context; Sentinel re-checks the cited code |
@apex-sentinel-staging pivot <why> |
Says the finding is wrong; Sentinel re-checks the cited code |
@apex-sentinel-staging like |
Marks the finding as useful |
@apex-sentinel-staging dislike <why> |
Marks it as not useful, so it is not raised again |
On this conversation, comment @apex-sentinel-staging review to run a full review once again.
|
No code problems were found in the changes at b1fcf14 since the earlier review at bd71651. They only touch comments and fix the one remaining note on comment wording; the previously reviewed code was not reviewed again. All 21 checks pass at this commit. Nothing from this review needs to change before merge. Not verified here: local tests and live daemon or device runs. |
Summary
Trims daemon code added by #5151, with no intended behaviour change.
cleanupExpiredLeasedSessionnow classifies its request once.bindOutsideRequestLocksstays: inlining it putcreateRequestExecutionScopeover the Fallow cyclomatic threshold.holdsSessionLocksstays because its invariant is false.resolveRequestExecutionLockPlanreads the session store beforerunLockedtakes any lock. Acloseplanned with no session omits the session's device lock unless its flags selected that device. Anopenahead of it can then publish the session, and without the checkclosetears it down while another request holds the device.normalizeLeaseId(leaseId) ?? leaseIdstays: its caller passes the raw request id.Value
lease-lifecycle.ts: 4 → 2.isBoundedCompositeRequestcall sites there: 2 → 1.Validation
At b208b5b (bd71651 restores the helper only):
lease-lifecycle.test.tsandrequest-execution-scope-lease-expiry.test.ts, unchanged: 29 passed. OXC formatted.Item 2 evidence, on the base commit:
a close that finds its session busy ends it once that request finishesfails.runLocked(session published after planning, device held) passed with the check and failed without it.No gates run locally; CI pending. No independent review; the author re-read the diff.
Security
Typed refusals,
dispatched: 'no',assertLeaseActiveand redaction are unchanged. The lease end is still bound before locks are taken.🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.